$(function(){
	
	var postId = getUrlParam('postId');
	var postType = getUrlParam('postType');

	getPostInfo(postId,postType);//获取帖子详情
})
var getPostInfo=function(postId,postType){
		$.ajax({
			type:'GET',
			url:baseurl+'/post/query/info.html',
			dataType: 'jsonp',
			data:{
                postId: postId,
                postType:postType
            }
		}).then(function(data){
            if(!data.resultCode){
            	var html = template('tpl_tieMod', data.result);
            	$('.tie-mod').html(html);
            	console.log(data.result);
            	var mySwiper = new Swiper('.swiper-container', {
	                speed: 1000,
	                spaceBetween: 0,
	                autoplay:3000,
	                onSlideChangeEnd:function(swiper){
	                    var page = $('.tie-mod .page');
	                    var length = swiper.wrapper[0].childElementCount;
	                    page.html(swiper.activeIndex+1+'/'+length);
	                    if(!swiper.autoplaying){
	                        swiper.startAutoplay();	
	                    }
	                }
	            });
	            Detail.getCommPraise(data.result);
            }else{
            	console.log(data.resultMsg)
        	}
        })
}